package com.ruoyi.project.system.function.bean;

import com.ruoyi.project.system.function.domain.DictMap;
import com.ruoyi.project.system.function.mapper.FunctionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: NH
 * @description: 菜单字典
 * @author: 郑吉志
 * @create: 2023-02-16 16:45
 **/
@Component
public class CategoryMap {
    public static Map<String,String> map=new HashMap<>();
    @Autowired
    FunctionMapper functionMapper;
    @PostConstruct
    public void init() {
//设计一级二级收入与无二级但是属于一级的名称字典对应的名称
        List<DictMap> list=functionMapper.getMap();
        for (DictMap dictMap : list)
            map.put(dictMap.getDictLabel(), dictMap.getDictType());
    }
}
